#import "SVProgressHUD+CP.h"
@implementation SVProgressHUD (CP)
+ (void)cp_showinfoWithInfo:(NSString *)info maskType:(SVProgressHUDMaskType)type
{
    [SVProgressHUD setShouldTintImages:NO];
    [SVProgressHUD setInfoImage:[UIImage imageNamed:@"ic_wait"]];
    dispatch_async(dispatch_get_main_queue(), ^{
        [SVProgressHUD setMinimumDismissTimeInterval:3.0];
        [SVProgressHUD setDefaultMaskType:type];
        [SVProgressHUD showInfoWithStatus:info];
    });
}
+ (void)cp_showErrorWithInfo:(NSString *)info maskType:(SVProgressHUDMaskType)type
{
    [SVProgressHUD setShouldTintImages:NO];
    [SVProgressHUD setErrorImage:[UIImage imageNamed:@"ic_error"]];
     dispatch_async(dispatch_get_main_queue(), ^{
     [SVProgressHUD setMinimumDismissTimeInterval:3.0];
    [SVProgressHUD setDefaultMaskType:type];
    [SVProgressHUD showErrorWithStatus:info];
          });
}
+ (void)cp_showSuccessWithInfo:(NSString *)info maskType:(SVProgressHUDMaskType)type
{
    [SVProgressHUD setShouldTintImages:NO];
    [SVProgressHUD setSuccessImage:[UIImage imageNamed:@"ic_right"]];
     dispatch_async(dispatch_get_main_queue(), ^{
    [SVProgressHUD setMinimumDismissTimeInterval:3.0];
    [SVProgressHUD setDefaultMaskType:type];
    [SVProgressHUD showSuccessWithStatus:info];
          });
}
+ (void)cp_showWaitStatusWithInfo:(NSString *)info maskType:(SVProgressHUDMaskType)type
{
     dispatch_async(dispatch_get_main_queue(), ^{
     [SVProgressHUD setMinimumDismissTimeInterval:2.0];
    [SVProgressHUD setDefaultMaskType:type];
    [SVProgressHUD showWithStatus:info];
          });
}
+ (void)cp_showProgressWithInfo:(float)progress stausInfo:(NSString *)info maskType:(SVProgressHUDMaskType)type
{
     dispatch_async(dispatch_get_main_queue(), ^{
    if(progress == 0.0f)
    {
        [SVProgressHUD setDefaultMaskType:type];
    }
    NSString *prog = [NSString stringWithFormat:@"%.2f",progress];
    [SVProgressHUD showProgress:prog.floatValue status:info];
          });
}
@end
